/*****************************************************************************
	File Name:			GameMap.h
	Authors:			Marc Willis, Trey Turley, Thomas Lee
	Class Names:		GameMap, GMException
	Description:		Contains prototypes for the GameMap class, which holds
						an array that describes the gameplay area,
						specifically which "blocks" are what color and if a
						player will lose if he/she/it lands on said block.
						Also contains exceptions for use in the GameMap class.
	Date Modified:		08/01/2010
						- made small tweaks
						07/29/2010
						- file created
*****************************************************************************/

#ifndef GAMEMAP_H
#define GAMEMAP_H

#include <iostream>

using namespace std;

class GameMap{
private:
	int **map;		//the array holding the map information
	int xSize;		//the size of the array on the x (left/right) axis
	int ySize;		//the size of the array on the y (up/down) axis
public:
/*****************************************************************************
	Function Name:		GameMap()
	Description:		Default constructor for the GameMap class, creates an
						empty GameMap of size x=400, y=300
	Input:
		(none)
	Output:
		(none)
*****************************************************************************/
	GameMap();
/*****************************************************************************
	Function Name:		GameMap(int,int)
	Description:		Constructor for the GameMap class, creates an empty
						GameMap of the given size
	Input:
		int x			the xSize of the GameMap
		int y			the ySize of the GameMap
	Output:
		(none)
*****************************************************************************/
	GameMap(int, int);
/*****************************************************************************
	Function Name:		GameMap(const GameMap&)
	Description:		Copy constructor for the GameMap class, creates a
						GameMap that matches the one given as a parameter
	Input:
		GameMap &o		the GameMap to be copied
	Output:
		(none)
*****************************************************************************/
	GameMap(const GameMap&);
/*****************************************************************************
	Function Name:		~GameMap()
	Description:		Destructor for the GameMap class, frees dynamically
						allocated memory
	Input:
		(none)
	Output:
		(none)
*****************************************************************************/
	~GameMap();
/*****************************************************************************
	Function Name:		getColor(int, int)
	Description:		returns the color of the given block, 0 for empty
	Input:
		int x			the x of the desired block
		int y			the y of the desired block
	Output:
		int				the color of the desired block
*****************************************************************************/
	int getColor(int, int);
/*****************************************************************************
	Function Name:		isSafe(int, int)
	Description:		returns true if the given block is a "safe" color (one
						that the player can land on without losing), otherwise
						returns false
	Input:
		int x			the x of the desired block
		int y			the y of the desired block
	Output:
		bool			the "safety" status of the given block
*****************************************************************************/
	bool isSafe(int, int);
/*****************************************************************************
	Function Name:		markBlock(int, int, int)
	Description:		"colors" the given block with the given color
	Input:
		int x			the x of the desired block
		int y			the y of the desired block
		int color		the color to make the desired block
	Output:
		(none)
*****************************************************************************/
	void markBlock(int, int, int);
};

class GMException
{
private:
	char* error;
public:
/*****************************************************************************
	Function Name:		GMException()
	Description:		Default constructor for the GMException class, creates
						an "unknown GMException"
	Input:
		(none)
	Output:
		(none)
*****************************************************************************/
	GMException();
/*****************************************************************************
	Function Name:		GMException(const GMException&)
	Description:		Copy constructor for the GMException class, more of a
						failsafe than anything, as I don't think it should be
						called.
	Input:
		GMException &o	the GMException to be copied
	Output:
		(none)
*****************************************************************************/
	GMException(const GMException&);
/*****************************************************************************
	Function Name:		GMException(const char*)
	Description:		Constructor for the GMException class, creates an 
						exception that prints the reason given in the string
	Input:
		char* str		the error message
	Output:
		(none)
*****************************************************************************/
	GMException(char*);
/*****************************************************************************
	Function Name:		~GMException()
	Description:		Destructor for the GMException class, frees
						memory
	Input:
		(none)
	Output:
		(none)
*****************************************************************************/
	~GMException();
/*****************************************************************************
	Function Name:		printEx(ostream&)
	Description:		prints the reason for the exception to the given
						ostream
	Input:
		ostream &out	the ostream to be printed to
	Output:
		(none)
*****************************************************************************/
	void printEx(ostream&);
};

#endif
